#ifndef FACTORYLINE_H_
#define FACTORYLINE_H_

#include <string>
#include <vector>
#include <map>

#include "smartcontainer.h"
#include "smartpointer.h"

class CFactoryObject
{
  
protected:
  
  int m_ID;
  std::string m_Tag;
  
public:
  
  inline const int & GetID()
  {
   
    return m_ID;
    
  }
  
  inline const std::string & GetTag()
  {
   
    return m_Tag;
    
  }
  
  CFactoryObject();
  
  virtual ~CFactoryObject() { }
  
};

class CFactoryLine
{

	private:

	  CSmartVector< CFactoryObject > m_pObjects;

	public:
		
		std::vector< CFactoryObject * >::iterator begin()
		{
			
			return m_pObjects.begin();
			
		}
		
		std::vector< CFactoryObject * >::iterator end()
		{
			
			return m_pObjects.end();
			
		}
		
		virtual CFactoryObject * Find( int );
		virtual CFactoryObject * Find( std::string ); 
		
		void Add( CFactoryObject * );
		
		virtual ~CFactoryLine()
		{
			
			m_pObjects.clear();
			
		}
		

};

class CFactoryLine_Map : public CFactoryLine
{

	private:

	  CSmartMap< std::string, CFactoryObject > m_pObjects;

	public:
		
		CFactoryObject * Get( std::string );
		CFactoryObject * Find( int );
		CFactoryObject * Find( std::string ); 
		
		void Add( std::string, CFactoryObject * );
		
		virtual ~CFactoryLine_Map()
		{
			
			m_pObjects.clear();
			
		}
		

};


#endif
